import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

//vuex
const store = new Vuex.Store({
	state: {
		carModel: [], //车型列表
		departureAirport: {}, //出发机场
		arriveAirport: {}, //到达机场
		lineId: '',  //线路id
		flightNo: '', //航班号
		charteredBusList: {}, //包车价格和车型列表
		handleTime: '', //预约用车时间
		startAddress: {}, //出发点
		endAddress: {}, //目标点
		price: 0,  //订单显示价格
		serviceType: '', //类型：1-预约用车(专车)；2-包车 3-接机; 4-送机 ; 5- 接站 ;6-送站；
		charterCarForm: {}, //包车选中的车型
		specialCarList: [],  //预约用车和接送机的价格车型列表
		specialCarForm: {}, //预约用车和接送机选中的车型
		carlevel: '',  //车型id
		cityCode: '',  //城市code
	},
	mutations: {
		setCarModel(state, value) {
			state.carModel = value;
		},
		setDepartureAirport(state, value) {
			state.departureAirport = value;
		},
		setArriveAirport(state, value) {
			state.arriveAirport = value;
		},
		setCharteredBusList(state, value) {
			state.charteredBusList = value;
		},
		setHandleTime(state, value) {
			state.handleTime = value;
		},
		setStartAddress(state, value) {
			state.startAddress = value;
		},
		setEndAddress(state, value) {
			state.endAddress = value;
		},
		setPrice(state, value) {
			state.price = value;
		},
		setServiceType(state, value) {
			state.serviceType = value;
		},
		setCharterCarForm(state, value) {
			state.charterCarForm = value;
		},
		setSpecialCarList(state, value) {
			state.specialCarList = value;
		},
		setSpecialCarForm(state, value) {
			state.specialCarForm = value;
		},
		setLineId(state, value) {
			state.lineId = value;
		},
		setFlightNo(state, value) {
			state.flightNo = value;
		},
		setCarlevel(state, value) {
			state.carlevel = value;
		},
		setCityCode(state, value) {
			state.cityCode = value;
		}
	}
})

export default store
